/**
 * anji-allways.com Inc.
 * Copyright (c) 2016-2017 All Rights Reserved.
 */
package cn.zhiwen.config;

import org.mybatis.spring.annotation.MapperScan;
import org.mybatis.spring.mapper.MapperScannerConfigurer;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * <pre>
 * MyBatisConfig
 * </pre>
 * @author guocheng
 * @version $Id: MyBatisConfig.java, v 0.1 2017年5月7日 下午1:30:03 guocheng Exp $
 */
@Configuration
@MapperScan(basePackages = "cn.zhiwen.mapper")
public class MyBatisMapperConfig {
    @Bean
    public MapperScannerConfigurer mapperScannerConfigurer() {
        MapperScannerConfigurer mapperScannerConfigurer = new MapperScannerConfigurer();
        mapperScannerConfigurer.setSqlSessionFactoryBeanName("sqlSessionFactory");
        mapperScannerConfigurer.setBasePackage("cn.zhiwen.mapper");
        return mapperScannerConfigurer;
    }

}
